widget: Emit ::focus regardless of container-ness and can-focus
authorTimm Bäder <mail@baedert.org>
Wed, 8 Feb 2017 12:35:23 +0000 (13:35 +0100)
committerTimm Bäder <mail@baedert.org>
Fri, 31 Mar 2017 07:50:39 +0000 (09:50 +0200)
gtk/gtkwidget.c

index 233dd6803df13b3036f521334157c73067c282ad..ff1527eee63a5dc6beebe49ed5fe2c61ca689c78 100644 (file)
@@ -9486,12 +9486,10 @@ gtk_widget_child_focus (GtkWidget       *widget,
       !gtk_widget_is_sensitive (widget))
     return FALSE;
 
-  /* child widgets must set CAN_FOCUS, containers
-   * don't have to though.
+  /* Emit ::focus in any case, even if can-focus is FALSE,
+   * since any widget might have child widgets that will take
+   * focus
    */
-  if (!GTK_IS_CONTAINER (widget) &&
-      !gtk_widget_get_can_focus (widget))
-    return FALSE;
 
   g_signal_emit (widget,
                 widget_signals[FOCUS],